local CoreProp = class("CoreProp")

function CoreProp:ctor(  )
	-- body
	self._sumPoint = 0 --总的属性点数
	
	self._values = {
		[Enums.CoreProp.Strength] = 0,
		[Enums.CoreProp.Intelligence] =  0,
		[Enums.CoreProp.Agility] =  0,
		[Enums.CoreProp.Endurance] = 0,
		[Enums.CoreProp.Spirit] = 0,
	}
end


function CoreProp:updateData(d)
	-- body
	self._sumPoint = d.SumPoint --总的属性点数
	self._values = {
		[Enums.CoreProp.Strength] = d.Strength or 0,
		[Enums.CoreProp.Intelligence] = d.Intelligence  or 0,
		[Enums.CoreProp.Agility] = d.Agility  or 0,
		[Enums.CoreProp.Endurance] = d.Endurance  or 0,
		[Enums.CoreProp.Spirit] = d.Spirit  or 0,
	}
end

function CoreProp:getValueByType(tp)
	return self._values[tp] or 0
end

function CoreProp:getSumPoint( )
	-- body
	return self._sumPoint
end

function CoreProp:getValues()
	return clone(self._values)
end

function CoreProp:getLeftPoint()
	local leftPoint = self._sumPoint
	for k , v in pairs(self._values) do
		leftPoint = leftPoint - v
	end
	return leftPoint
end


return CoreProp